package com.zork.cmdb.webapi.api;

import com.zork.cmdb.webapi.common.response.ResponseEntityEnum;
import com.zork.cmdb.webapi.domain.vo.ModuleVO;
import com.zork.cmdb.webapi.service.ModuleService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author chenjh
 * @date 2018/5/16
 * @description
 */
@RestController
@RequestMapping("/modules")
public class ModuleController {

    @Autowired
    private ModuleService moduleService;

    @ApiOperation(value = "获取模型信息列表", notes = "获取模型信息列表")
    @GetMapping("")
    public ResponseEntityEnum listModule() {
        List<ModuleVO> moduleList = moduleService.listModule();
        ResponseEntityEnum result = ResponseEntityEnum.SUCCESS.setData(moduleList);
        return result;
    }
}
